\begin{tikzpicture}[>=Stealth,scale=0.4]
    \draw [->] (-1,0) -- (9,0) node[anchor=north] {$n$};
    \draw [->] (0,-1) -- (0,18) node[anchor=east] {$a_n$};
    \node at (-0.5,-0.5) {$O$};
    \foreach \x in {1,...,8} {
        \draw (\x,0.2) -- (\x,0) node[anchor=north] {$\x$};
    }
    \foreach \y in {2,4,...,16} {
        \draw (0.2,\y) -- (0,\y) node[anchor=east] {$\y$};
    }

    \draw[domain=0.2:8.4,smooth,samples=10] plot (\x, {2*\x - 1});
\end{tikzpicture}